package com.example.demo.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by Hy on 2018/8/7.
 * 乐观锁测试实体类
 */
@Entity
@Table(name = "data_version")
public class DataVersion implements Serializable{
    @Id
    private long id;
    private String name;
    private int age;
    @Version
    private Long version;
    @Column(name = "date_add", insertable = false, updatable = false)
    private Date dateAdd;
    @Column(name = "date_upd",insertable = false,updatable = false)
    private Date dateUpd;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public Date getDateAdd() {
        return dateAdd;
    }

    public void setDateAdd(Date dateAdd) {
        this.dateAdd = dateAdd;
    }

    public Date getDateUpd() {
        return dateUpd;
    }

    public void setDateUpd(Date dateUpd) {
        this.dateUpd = dateUpd;
    }

    @Override
    public String toString() {
        return "DataVersion{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", version=" + version +
                ", dateAdd=" + dateAdd +
                ", dateUpd=" + dateUpd +
                '}';
    }
}
